home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_319 / cnewssrc / cnews.orig.lzh / input / Makefile < prev    next >
Makefile  |  1989-06-27  |  4KB  |  141 lines

  1. # You get your choice of rnews.immed or rnews.batch; rnews.immed tries
  2. # to start processing immediately, while rnews.batch waits for somebody
  3. # else (cron) to do it.  Running rnews.immed might, perhaps, be reasonable
  4. # if your news load is light and you are wildly impatient about processing
  5. # incoming news.  Otherwise, leave this alone.
  6. RNEWS = rnews.batch
  7.  
  8. DEFINES =
  9. COPTS = -O
  10. CFLAGS = $(COPTS) $(DEFINES) -I../include
  11. LINTFLAGS = $(DEFINES) -I../include -ha
  12. LDFLAGS = $(CFLAGS)
  13. LIBS= ../libcnews.a
  14. BATCH = ../batch
  15. THEMBIN = newsrun newsrunning c7decode bdecode recenews recpnews rnews
  16. THEM = newsspool $(THEMBIN)
  17. RBIN = /bin
  18. # =()<NEWSARTS = @<NEWSARTS>@>()=
  19. NEWSARTS = /usr/spool/news
  20. # =()<NEWSBIN = @<NEWSBIN>@>()=
  21. NEWSBIN = /usr/lib/newsbin
  22. # workaround for System V make bug
  23. SHELL = /bin/sh
  24. DTR = README Makefile newsrun newsrunning newsspool.c c7decode.c rnews.batch \
  25.     rnews.8 bdecode.c recenews recpnews
  26.  
  27. all:    $(THEM) rnews
  28.  
  29. bininstall:    all
  30.     chmod +x $(THEM) rnews
  31.     -if test ! -d $(NEWSBIN)/input ; then mkdir $(NEWSBIN)/input ; fi
  32.     cp $(THEM) $(NEWSBIN)/input
  33.     cp rnews $(RBIN)/rnews
  34.     cp rnews $(RBIN)/cunbatch
  35.     : "and newsspool needs to be made setuid-news"
  36.  
  37. newsinstall:
  38.     : nothing
  39.  
  40. newsspool: newsspool.o $(LIBS)
  41.     $(CC) $(LDFLAGS) newsspool.o $(LIBS) -o $@
  42.  
  43. c7decode: c7decode.o $(LIBS)
  44.     $(CC) $(LDFLAGS) c7decode.o $(LIBS) -o $@
  45.  
  46. bdecode: bdecode.o $(BATCH)/crctab.o $(LIBS)
  47.     $(CC) $(LDFLAGS) bdecode.o $(BATCH)/crctab.o $(LIBS) -o $@
  48.  
  49. $(BATCH)/crctab.o:    $(BATCH)/crctab.c
  50.     ( cd $(BATCH) ; make crctab.o )
  51.  
  52. bdecode.o:    bdecode.c $(BATCH)/coder.h
  53.     $(CC) -c -I$(BATCH) $(CFLAGS) bdecode.c
  54.  
  55. lint:    newsspool.c
  56.     lint $(LINTFLAGS) newsspool.c 2>&1 | tee lint
  57.  
  58. test.1:
  59.     echo '#! rnews' >$@
  60.     echo 'here is a phony first batch' >>$@
  61.  
  62. test.2:
  63.     echo '#! cunbatch' >$@
  64.     echo '#! rnews' >>$@
  65.     echo 'here is a phony second batch' >>$@
  66.  
  67. test.3p:
  68.     echo '#! rnews' >$@
  69.     echo 'here is a phony third batch' >>$@
  70.  
  71. test.3:    test.3c
  72.     ( echo '#! cunbatch' ; cat test.3c ) >$@
  73.  
  74. test.3c:    test.3p
  75.     : compress tends to return silly exit status for tiny inputs
  76.     -compress -b12 <test.3p >$@
  77.  
  78. test.out:
  79.     echo '#! rnews' >$@
  80.     echo 'here is a phony first batch' >>$@
  81.     echo '#! rnews' >>$@
  82.     echo 'here is a phony second batch' >>$@
  83.     echo '#! rnews' >>$@
  84.     echo 'here is a phony third batch' >>$@
  85.  
  86. rnews.immed:    rnews.batch
  87.     sed '/qqq/s/newsspool/& -i/' rnews.batch >$@
  88.  
  89. rnews:    rnews.batch rnews.immed
  90.     cp $(RNEWS) rnews
  91.     chmod +x rnews
  92.  
  93. setup:    all
  94.     chmod +x rnews.batch rnews.immed
  95.     rm -rf bin
  96.     mkdir bin
  97.     cp $(THEM) bin
  98.     rm -f tmp.1
  99.     here=`pwd` ; echo "cat >>$$here/tmp.1" >bin/relaynews
  100.     echo "echo 1" >bin/spacefor
  101.     echo 'ln $$*' >bin/newslock
  102.     echo 'echo 10' >bin/sizeof
  103.     chmod +x bin/*
  104.     rm -rf in.coming
  105.     mkdir in.coming
  106.  
  107. r:    all test.1 test.2 test.3 test.3c test.out setup
  108.     chmod +x $(THEM)
  109.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.1
  110.     cmp in.coming/* test.1
  111.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.2
  112.     sed 1d test.2 >tmp.2
  113.     cmp `ls -t in.coming | sed -n '1s;^;in.coming/;p'` tmp.2
  114.     rm tmp.2
  115.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.3
  116.     cmp `ls -t in.coming | sed -n '1s;^;in.coming/;p'` test.3c
  117.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrunning off
  118.     test -r in.coming/stop
  119.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrunning on
  120.     test ! -r in.coming/stop
  121.     mkdir in.coming/bad
  122.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./newsrun
  123.     cmp tmp.1 test.out
  124.     test " `echo in.coming/*`" = ' in.coming/bad'
  125.     rm tmp.1
  126.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.1
  127.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.batch <test.2
  128.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./rnews.immed <test.3
  129.     cmp tmp.1 test.out
  130.     test " `echo in.coming/*`" = ' in.coming/bad'
  131.     rm tmp.1
  132.     rm -r bin in.coming
  133.  
  134. clean:
  135.     rm -f *.o newsspool c7decode tmp.? test.* dtr lint rnews rnews.immed
  136.     rm -f bdecode
  137.     rm -rf in.coming bin
  138.  
  139. dtr:    $(DTR)
  140.     makedtr $(DTR) >dtr
  141.